<% layout('/layouts/default.html', {title: '员工信息管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('员工信息管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('employee:comEmployee:edit')){ %>
					<a href="${ctx}/employee/comEmployee/form" class="btn btn-default btnTool" title="${text('新增com_employee')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${comEmployee}" action="${ctx}/employee/comEmployee/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('所属门店id')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="storeId" maxlength="11" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<div class="form-group">
					<label class="control-label">${text('姓名')}：</label>
					<div class="control-inline">
						<#form:input path="name" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('性别，0男，1女')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="sex" maxlength="4" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('身份证号码')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="idNum" maxlength="255" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('联系电话')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="tel" maxlength="255" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('职务')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="duty" maxlength="255" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('是否可进入专间，0可以，1不可以')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="accessPermission" maxlength="4" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('人脸图片地址')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="employeePhoto" maxlength="255" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('是否是管理员0不是，1是')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="isManager" maxlength="4" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('健康证编号')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="healthNum" maxlength="255" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('健康证类别')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="healthType" maxlength="255" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="form-group">-->
					<!--<label class="control-label">${text('备注')}：</label>-->
					<!--<div class="control-inline">-->
						<!--<#form:input path="remarks" maxlength="255" class="form-control width-120"/>-->
					<!--</div>-->
				<!--</div>-->
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [

		{header:'${text("姓名")}', name:'name', index:'a.name', width:150, align:"center", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/employee/comEmployee/form?id='+row.id+'" class="btnList" data-title="${text("编辑员工信息")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("性别")}', name:'sex', index:'a.sex', width:150, align:"center",formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_user_sex')}, val, '${text("未知")}', true);
		}},
		{header:'${text("所属门店")}', name:'storeName', index:'a.store_name', width:150, align:"center"},
		{header:'${text("身份证号码")}', name:'idNum', index:'a.id_num', width:150, align:"center"},
		{header:'${text("联系电话")}', name:'tel', index:'a.tel', width:150, align:"center"},
		{header:'${text("职务")}', name:'duty', index:'a.duty', width:150, align:"center"},
		{header:'${text("是否可进入专间")}', name:'accessPermission', index:'a.access_permission', width:150, align:"center",formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_yes_no')}, val, '${text("未知")}', true);
		}},
		{header:'${text("照片")}', name:'employeePhoto', index:'a.employee_photo', width:150, align:"center",formatter:function (val, obj, row, act) {
			return '<img src="'+ val+ '" style="width:50px;height:50px"/>'
		}},
		{header:'${text("是否是管理员")}', name:'isManager', index:'a.is_manager', width:150, align:"center",formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_yes_no')}, val, '${text("未知")}', true);
		}},
		{header:'${text("健康证编号")}', name:'healthNum', index:'a.health_num', width:150, align:"center"},
		{header:'${text("健康证类别")}', name:'healthType', index:'a.health_type', width:150, align:"center"},
		{header:'${text("备注")}', name:'remarks', index:'a.remarks', width:150, align:"center"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('employee:comEmployee:edit')){ %>
				actions.push('<a href="${ctx}/employee/comEmployee/form?id='+row.id+'" class="btnList" title="${text("编辑员工信息")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				if (row.status == Global.STATUS_NORMAL){
					actions.push('<a href="${ctx}/employee/comEmployee/disable?id='+row.id+'" class="btnList" title="${text("停用此员工")}" data-confirm="${text("确认要停用该员工吗？")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
				}
				if (row.status == Global.STATUS_DISABLE){
					actions.push('<a href="${ctx}/employee/comEmployee/enable?id='+row.id+'" class="btnList" title="${text("启用此员工")}" data-confirm="${text("确认要启用该员工吗？")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
				}
				actions.push('<a href="${ctx}/employee/comEmployee/delete?id='+row.id+'" class="btnList" title="${text("删除此员工")}" data-confirm="${text("确认要删除该员工吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>